package com.googlecode.flair
{
	import flash.events.Event;
	import flash.events.EventDispatcher;
	
	[Bindable]
	public final class FlairModelLocator extends EventDispatcher
	{
		
		public static var instance : FlairModelLocator = new FlairModelLocator()

		public var currentComponent : IFlairComponent = null;
		private var _advisedComponent : Object = null;
		public var rootComponent : IFlairComponent = null;
		
		[Bindable(event="advisedComponentChanged")]
		public function isA(clasz : Class) : Boolean {
			return instance.advisedComponent is clasz;
		}
		
		
		public function set advisedComponent(advisedComponent :  Object) : void {
			this._advisedComponent = advisedComponent;
			dispatchEvent(new Event("advisedComponentChanged"));
		}
		
		public function get advisedComponent() : Object 
		{
			return this._advisedComponent;
		}
	}
}